<?php
require_once '../../vendor/autoload.php';
// post.php ???
// This all was here before  ;)
$t = time();
$entryData = array(
    'cat'     => 'kittensCategory'//'category'.$t//$_POST['category']
    , 'title'   => 'title'.$t//$_POST['title']
     , 'article' => 'article'.$t//$_POST['article']
     , 'when'    => $t
);

//$pdo->prepare("INSERT INTO blogs (title, article, category, published) VALUES (?, ?, ?, ?)")
//        ->execute($entryData['title'], $entryData['article'], $entryData['cat'], $entryData['when']);

// This is our new stuff
$context = new ZMQContext();
$socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
$socket->connect("tcp://localhost:5555");

$socket->send(json_encode($entryData));
echo "post ok\n";

// 1 php post.php
// 2 在浏览器里输入http://127.0.0.1:1337